<script type="text/ecmascript-6">
	/**
	 * Created by wcz on 2017/1/8.
	 */
	export default {
		data () {
			return {
				username: '',
                password: ''
            }
		},
		computed: {},
		mounted () {

		},
		methods: {
			signIn () {
				let postData = new FormData();
				postData.append('phone', this.username);
				postData.append('password', this.password);

				this.jax('/downstreams/login', postData, {errmsg: '登录失败', loading: true})
					.then(res => {
						if (res.success) {
							this.$router.push('/home/submit');
						}
					})
			},
        },
	};
</script>

<template>
    <div class="sign__in" layout="column top-center">
        <img class="logo" src="/imgs/logo-off.png"/>
        <div class="sign__inputer">
            <mt-field label="用户名" v-model="username" placeholder="请输入手机号"></mt-field>
            <mt-field label="密码" v-model="password" type="password" placeholder="请输入密码"></mt-field>
        </div>

        <mt-button class="sign__button sign__button--or z1" type="primary" size="large" @click="signIn">登录</mt-button>
    </div>
</template>